
export const mixin = {
  data() {
    return {
      Store: this.$store.state,
      indexMethod:1,
      listLoading:false,
    }
  },
  created() {

  },
  mounted() {
  },
  methods: {
    handleSizeChange(val) {
      this.listQuery.limit = val;
      this.getList();
    },
    handleCurrentChange(val) {
      this.listQuery.page = val;
      this.getList();
    },
    Notice(title = '注意', txt = '', type = "info") {
      this.$notify({
        title: title,
        message: txt,
        type: type,
        duration: 1600
      });
    },
    CheckForm(formname = '') {
      return new Promise((resolve, reject) => {
        this.$refs[formname].validate(valid => {
          if (valid) resolve(true)
          else resolve(false)
        })
        reject()
      })
    },
    logOut(){
      this.$confirm('此操作将登出页面, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {

          this.$store.commit('clearToken')
          this.$router.push('/')
        }).catch(() => {          
        });
    },
    delConfirm(){
      return this.$confirm("此操作将永久删除, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
    }
  }
};